mixin jsFile(files)
	each file in files
		script(type='text/javascript' src=file)

mixin cssFile(files)
	each file in files
		link(rel='stylesheet' href=file)

mixin commonCSS
	style.
		body{
			padding: 50px;
			font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
			background: url("/public/bg2.png") left top repeat;
		}

		a{
			color: #00B7FF
		}

		li{
			font-size: 18px;
			margin-top: 10px;
		}

mixin commonJS
	script(type='text/javascript').
		console.log('加载公共脚本文件');

mixin debugJS
	//- 手机端console插件
	script(type='text/javascript' src='/public/vconsole.min.js')
	script(type='text/javascript').
		var vConsole = new VConsole();

mixin debugCSS(ip)
	script(type='text/javascript' src="http://" + ip + ":8081/target/target-script-min.js#anonymous")

mixin docHead(config)
	doctype html
	html(lang='zh-CN')
		head
			title #{config.title}
			if config.favicon
				link(rel='shortcut icon' href=config.favicon)
			meta(charset='utf-8')
			meta(http-equiv='X-UA-Compatible' content='IE=edge,chrome=1')
			meta(name='viewport' content='width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui')
			meta(name='renderer' content='webkit')
			if config.showProgressBar
				link(rel='stylesheet' href='https://cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-loading-bar.min.css')
				script(src='https://cdn.bootcss.com/pace/1.0.2/pace.min.js')
			if config.keywords
				meta(name='keywords' content=config.keywords)
			if config.description
				meta(name='description' content=config.description)
			if config.cssFile && config.cssFile.length > 0
				+cssFile(config.cssFile)
			script(async src='https://www.googletagmanager.com/gtag/js?id=UA-109240313-1')
			script(type='text/javascript').
				window.dataLayer = window.dataLayer || [];
				function gtag(){dataLayer.push(arguments);}
				gtag('js', new Date());
				gtag('config', 'UA-109240313-1');
			script(type='text/javascript').
				var _hmt = _hmt || [];
				(function() {
				var hm = document.createElement("script");
				hm.src = "https://hm.baidu.com/hm.js?dd6484741f3715e3bb10b2c134341631";
				var s = document.getElementsByTagName("script")[0]; 
				s.parentNode.insertBefore(hm, s);
				})();
			if config.debugJS
				+debugJS
			if config.debugCSS_IP
				+debugCSS(config.debugCSS_IP)
			if config.jsFile && config.jsFile.length > 0
				+jsFile(config.jsFile)
			if !config.notCommon
				+commonCSS
				+commonJS

		body
			noscript
				#noScript
					div
						h2 '请开启浏览器的Javascript功能'
						p 亲，没它我们玩不转啊！求您了，开启Javascript吧！
							br/
							|不知道怎么开启Javascript？那就请
							a(href='//www.baidu.com/s?wd=%E5%A6%82%E4%BD%95%E6%89%93%E5%BC%80Javascript%E5%8A%9F%E8%83%BD' rel='nofollow' target='_blank') 猛击这里
							|!